<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="common/dev_header.jsp"%>

      <div class="content-wrapper">
        <div class="page-title">
          <div>
            <h5>欢迎回来，${devUserInfo.devName}开发者</h5>
            <p><i class="fa fa-dashboard"></i>2017-10-14</p>
          </div>
          <div>
            <ul class="breadcrumb">
              <li><i class="fa fa-home fa-lg"></i></li>
              <li><a href="<%=request.getContextPath()%>/appInfo/showApp">App管理</a></li>d
            </ul>
          </div>
        </div>
        <div class="row">
          <div class="col-md-12">
            <div class="card">
              <div class="card-body">
                <table class="table table-hover table-bordered" id="sampleTable">
                  <thead>
                    <tr>
                      <th>软件名称</th>
                      <th>APK名称</th>
                      <th>软件大小</th>
                      <th>所属平台</th>
                      <th>所属分类</th>
                      <th>状态</th>
                      <th>下载次数</th>
                      <th>最新版本</th>
                      <th>操作</th>
                    </tr>
                  </thead>
                  <tbody>
                  	<c:forEach items="${appInfo}" var="appInfo">
                    <tr>
                      <td>${appInfo.softwareName}</td>
                      <td>${appInfo.APKName}</td>
                      <td>${appInfo.softwareSize}</td>
                      <td>${appInfo.flatformId}</td>
                      <td>${appInfo.categoryLevel1}>${appInfo.categoryLevel2}>${appInfo.categoryLevel3}</td>
                      <td>${appInfo.status}</td>
                      <td>${appInfo.downloads}</td>
                      <td>${appInfo.versionId}</td>
                      <td><div class="btn-group">
													<button type="button" class="btn btn-danger">点击操作</button>
													<button type="button"
														class="btn btn-danger dropdown-toggle"
														data-toggle="dropdown" aria-expanded="false">
														<span class="caret"></span> <span class="sr-only">Toggle
															Dropdown</span>
													</button>
													<ul class="dropdown-menu" role="menu">
														<li><c:choose>
																<c:when
																	test="${appInfo.status == 2 || appInfo.status == 5}">
																	<a class="saleSwichOpen" saleSwitch="open"
																		appinfoid=${appInfo.id }
																		appsoftwarename=${appInfo.softwareName }
																		data-toggle="tooltip" data-placement="top" title=""
																		data-original-title="恭喜您，您的审核已经通过，您可以点击上架发布您的APP">上架</a>
																</c:when>
																<c:when test="${appInfo.status == 4}">
																	<a class="saleSwichClose" saleSwitch="close"
																		appinfoid=${appInfo.id }
																		appsoftwarename=${appInfo.softwareName }
																		data-toggle="tooltip" data-placement="top" title=""
																		data-original-title="您可以点击下架来停止发布您的APP，市场将不提供APP的下载">下架</a>
																</c:when>
															</c:choose></li>
														<li><a class="addVersion" appinfoid="${appInfo.id }"
															data-toggle="tooltip" data-placement="top" title=""
															data-original-title="新增APP版本信息">新增版本</a></li>
														<li><a class="modifyVersion"
															appinfoid="${appInfo.id }"
															versionid="${appInfo.versionId }"
															status="${appInfo.status }"
															statusname="${appInfo.statusName }" data-toggle="tooltip"
															data-placement="top" title=""
															data-original-title="修改APP最新版本信息">修改版本</a></li>
														<li><a class="modifyAppInfo"
															appinfoid="${appInfo.id }" status="${appInfo.status }"
															statusname="${appInfo.statusName }" data-toggle="tooltip"
															data-placement="top" title=""
															data-original-title="修改APP基础信息">修改</a></li>
														<li><a class="viewApp" appinfoid=${appInfo.id }
															data-toggle="tooltip" data-placement="top" title=""
															data-original-title="查看APP基础信息以及全部版本信息">查看</a></li>
														<li><a class="deleteApp" appinfoid=${appInfo.id }
															appsoftwarename=${appInfo.softwareName }
															data-toggle="tooltip" data-placement="top" title=""
															data-original-title="删除APP基础信息以及全部版本信息">删除</a></li>
													</ul>
												</div></td>
                    </tr>
                    </c:forEach>
                  </tbody>
                </table>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
   
    <!-- Data table plugin-->
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/plugins/jquery.dataTables.min.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/plugins/dataTables.bootstrap.min.js"></script>
    <<%--script type="text/javascript">$('#sampleTable').DataTable();</script>--%>
    <%--<script type="text/javascript">
        $(function () {
            $.post("<%=request.getContextPath()%>/appInfo/showApp",function (data) {
                alert(data);
            })
        })
    </script>--%>
  </body>
</html>